<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style type="text/css">
        * {
            padding: 0;
            margin: 0;
            border: 0;
            list-style: none;
        }

        .box {
            width: 320px;
            border: 1px solid #ccc;
            border-radius: 5px;
            margin: 50px auto;
        }

        .box .first li {
            border-bottom: 1px solid #ccc;
            line-height: 44px;
            text-indent: 10px;
        }


        .box .first li span {
            width: 16px;
            height: 16px;
            display: inline-block;
            /* float: right; */
            background: url("images/arrow_right.png") no-repeat;
            position: relative;
            top: 10px;
            right: 5px;
            transition: 0.2s;
        }

        .box .first .cur span {
            transform: rotate(90deg);
        }


        .sec {
            background: #2d2c41;
            display: none;
        }

        .sec li {
            border-bottom: 1px solid #4b4a5e;
            color: #fff;
        }

        .sec li:hover {
            background: #C12C3E;
        }
    </style>


    <script src="js/jquery.min.3.4.1.js"></script>
    <script>
        $(function () {
            $('.first>li').click(function () {
                $(this).children('.sec').slideToggle()
                $(this).siblings().children('.sec').slideUp()
            })
        })



    </script>
</head>

<body>
    <div class="box">

        <ul class="first">
            <li><span></span>第一级菜单
                <ul class="sec">
                    <li>第二级菜单1</li>
                    <li>第二级菜单2</li>
                    <li>第二级菜单3</li>
                    <li>第二级菜单4</li>
                </ul>
            </li>
            <li><span></span>第一级菜单
                <ul class="sec">
                    <li>第二级菜单1</li>
                    <li>第二级菜单2</li>
                    <li>第二级菜单3</li>
                    <li>第二级菜单4</li>
                </ul>
            </li>
            <li><span></span>第一级菜单
                <ul class="sec">
                    <li>第二级菜单1</li>
                    <li>第二级菜单2</li>
                    <li>第二级菜单3</li>
                    <li>第二级菜单4</li>
                </ul>
            </li>
            <li><span></span>第一级菜单
                <ul class="sec">
                    <li>第二级菜单1</li>
                    <li>第二级菜单2</li>
                    <li>第二级菜单3</li>
                    <li>第二级菜单4</li>
                </ul>
            </li>
            <li><span></span>第一级菜单
                <ul class="sec">
                    <li>第二级菜单1</li>
                    <li>第二级菜单2</li>
                    <li>第二级菜单3</li>
                    <li>第二级菜单4</li>
                </ul>
            </li>
            <li><span></span>第一级菜单
                <ul class="sec">
                    <li>第二级菜单1</li>
                    <li>第二级菜单2</li>
                    <li>第二级菜单3</li>
                    <li>第二级菜单4</li>
                </ul>
            </li>
        </ul>

    </div>
</body>

</html>